package com.geek.javase.ch13.videodemo;

import java.io.*;

/*
 *@author wangpeng
 *2025/10/25 10:06
 *@description TODO
 */

public class InputStreamReaderDemo1 {
    public static void main(String[] args) {
        try (
                FileInputStream fis = new FileInputStream("D:\\CodeFile\\igeeklearn\\testJavaSE\\src\\com\\geek\\javase\\ch13\\videodemo\\EncodingTest.txt");
                //InputStreamReader isr = new InputStreamReader(fis,"GBK");
                InputStreamReader isr = new InputStreamReader(fis, "UTF-8");
        ) {
            char[] chars = new char[1024];
            int len = isr.read(chars);
            System.out.println(new String(chars, 0, len));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


